CREATE TABLE [dbo].[Fabrics](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[Name] [nvarchar](255) NOT NULL,
	[Description] [nvarchar](255) NULL,
	[CreatedDate] [datetime] NOT NULL,
	[CreatedBy] [bigint] NOT NULL,
 CONSTRAINT [PK_Fabrics] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[Fabrics]  WITH CHECK ADD  CONSTRAINT [FK__Fabrics__Create__68487DD7] FOREIGN KEY([CreatedBy])
REFERENCES [dbo].[Users] ([Id])
GO

ALTER TABLE [dbo].[Fabrics] CHECK CONSTRAINT [FK__Fabrics__Create__68487DD7]
GO

ALTER TABLE [dbo].[Fabrics] ADD  CONSTRAINT [DF_Fabrics_CreatedDate]  DEFAULT (getdate()) FOR [CreatedDate]
GO


INSERT INTO [Modules]([Id],[Name],[IsEnabled],[CreatedDate])
     VALUES(4,'Telas',1,GETDATE())
	 
INSERT INTO [Permissions]([Id],[PermissionTypeId],[ModuleId],[CreatedDate])
     VALUES (13,1,4,GETDATE())
INSERT INTO [Permissions]([Id],[PermissionTypeId],[ModuleId],[CreatedDate])
     VALUES (15,2,4,GETDATE())
INSERT INTO [Permissions]([Id],[PermissionTypeId],[ModuleId],[CreatedDate])
     VALUES (15,3,4,GETDATE())
INSERT INTO [Permissions]([Id],[PermissionTypeId],[ModuleId],[CreatedDate])
     VALUES (16,4,4,GETDATE())
	 
INSERT INTO [RolePermissions]([RoleId],[PermissionId],[CreatedDate])
     VALUES(1,13,GETDATE())
INSERT INTO [RolePermissions]([RoleId],[PermissionId],[CreatedDate])
     VALUES(1,14,GETDATE())
INSERT INTO [RolePermissions]([RoleId],[PermissionId],[CreatedDate])
     VALUES(1,15,GETDATE())
INSERT INTO [RolePermissions]([RoleId],[PermissionId],[CreatedDate])
     VALUES(1,16,GETDATE())